import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/5/12
 * Time:18:43
 **/
public class Main1 {
    /**
     * 每日一题-小易的升级之路
     *
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int a = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();//获取到对应的能力值
                //判断大小
                if (a > arr[i]) {
                    a += arr[i];
                } else {
                    a += getGYS(a, arr[i]);
                }
            }
            System.out.println(a);
        }
    }

    /**
     * 求最大公约数
     *
     * @param a 数字1
     * @param b 数字2
     * @return 返回最大公约数
     */
    public static int getGYS(int a, int b) {
        if (b % a == 0) {
            return a;
        } else {
            return getGYS(b % a, a);
        }
    }

}
